package com.cw2.structural.flyweight;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.ToString;

@AllArgsConstructor
@ToString
public class BeautifulWaitress extends AbstractWaitressFlyweight {
    @ApiModelProperty("id")
    private String id;

    @ApiModelProperty("名字")
    private String name;

    @ApiModelProperty("年龄")
    private Integer age;

    /***
     * 提供服务方法
     */
    @Override
    void isService() {
        System.out.println("工号："+id+"；"+name+" "+age+" 正在为您服务...");
        // 改变当前状态
        this.canService = false;
    }

    /**
     * 结束当前服务
     */
    @Override
    void end() {
        System.out.println("工号："+id+"；"+name+" "+age+" 结束服务...");
        // 改变当前状态
        this.canService = true;
    }
}
